Skip to content

fix(openapi): update script for darwin and regen#525

Merged
wolf31o2 merged 1 commit intomainfrom
fix/openapi-darwin
Jan 25, 2026
Merged

fix(openapi): update script for darwin and regen#525
wolf31o2 merged 1 commit intomainfrom
fix/openapi-darwin

Conversation

@wolf31o2
Copy link
Copy Markdown
Member

@wolf31o2 wolf31o2 commented Jan 25, 2026

Summary by cubic

Fix OpenAPI generation on macOS and regenerate the client with Go 1.24.0 and the latest generator.

  • Bug Fixes

    • Make openapi.sh compatible with macOS by handling sed -i differences.
  • Dependencies

    • Regenerated client with OpenAPI Generator 7.18.0-SNAPSHOT (README and VERSION updated).
    • Bumped Go to 1.24.0 and github.com/stretchr/testify to v1.11.1; updated go.sum.
    • Added git_push.sh helper script.

Written for commit f81dddc. Summary will update on new commits.

Summary by CodeRabbit

  • New Features

    • Added automated Git push script for seamless repository deployment workflows.
  • Chores

    • Updated OpenAPI generator to version 7.18.0-SNAPSHOT.
    • Upgraded Go language version to 1.24.0.
    • Updated testify dependency to v1.11.1.

✏️ Tip: You can customize this high-level summary in your review settings.

Signed-off-by: Chris Gianelloni <wolf31o2@blinklabs.io>
@wolf31o2 wolf31o2 requested review from a team as code owners January 25, 2026 20:04
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Jan 25, 2026

📝 Walkthrough

Walkthrough

This pull request updates the OpenAPI generator configuration and Go module dependencies. The generator version is bumped from 7.14.0 to 7.18.0-SNAPSHOT in the VERSION file and README documentation. The Go language version in go.mod is updated from 1.18 to 1.24.0, and the testify dependency is bumped to v1.11.1. The openapi.sh script is modified to handle OS-specific sed syntax when modifying go.mod. A new git_push.sh script is added to automate pushing local projects to remote Git repositories with support for optional configuration parameters and token-based authentication.

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title mentions 'update script for darwin' which aligns with the OS-specific sed modification in openapi.sh, and 'regen' reflects the version updates and OpenAPI generator changes.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 6 files

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Fix all issues with AI agents
In `@openapi/git_push.sh`:
- Around line 44-49: The script currently embeds GIT_TOKEN into the remote URL
(the git remote add origin ... branch that uses ${GIT_TOKEN}), which leaks the
token into .git/config and process listings; change the flow to add the remote
without the token (use the branch of the script that uses
${git_host}/${git_user_id}/${git_repo_id}.git) and authenticate via a credential
helper or an ephemeral method instead—for example, set up a temporary credential
using git credential or use git -c http.extraheader="AUTHORIZATION: Bearer
$GIT_TOKEN" for the push, or configure GIT_ASKPASS to supply the token—so remove
any code that constructs the URL with ${GIT_TOKEN} and replace it with a
token-passing approach that does not store the token in .git/config.
- Line 57: The push command currently pipes git push origin master 2>&1 into
grep -v 'To https', which removes the "To https" line (hiding the remote URL)
rather than showing it; update the pipeline to either remove the grep entirely
to preserve all output or change to grep 'To https' (without -v) to explicitly
show the URL line (find the git push origin master command in git_push.sh and
adjust the grep usage accordingly).

In `@openapi/README.md`:
- Line 10: Update the OpenAPI generator version string in the README by
replacing the pre-release token "Generator version: 7.18.0-SNAPSHOT" with the
stable release "Generator version: 7.18.0" so the documentation references the
production-ready generator; locate the exact line containing the "Generator
version: 7.18.0-SNAPSHOT" entry and change it to "Generator version: 7.18.0".
🧹 Nitpick comments (3)
openapi.sh (1)

5-5: Hardcoded version replacement is brittle.

The sed pattern go 1.23 is hardcoded, meaning if the OpenAPI generator changes its output Go version, this substitution will silently fail. Consider using a more flexible pattern.

♻️ Suggested improvement
-cd openapi && if [[ "$OSTYPE" == "darwin"* ]]; then sed -i '' 's/go 1.23/go 1.24.0/' go.mod; else sed -i 's/go 1.23/go 1.24.0/' go.mod; fi && go mod tidy
+cd openapi && if [[ "$OSTYPE" == "darwin"* ]]; then sed -i '' 's/^go 1\.[0-9]\+$/go 1.24.0/' go.mod; else sed -i 's/^go 1\.[0-9]\+$/go 1.24.0/' go.mod; fi && go mod tidy

This matches any go 1.X line, making it resilient to generator version changes.

openapi/git_push.sh (2)

53-57: Hardcoded master branch may not match repository default.

Many repositories now use main as the default branch. Consider parameterizing the branch name or detecting it dynamically.

♻️ Optional improvement
+git_branch=${5:-master}
+
-git pull origin master
+git pull origin $git_branch
 
 # Pushes (Forces) the changes in the local repository up to the remote repository
-echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
-git push origin master 2>&1 | grep -v 'To https'
+echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git (branch: $git_branch)"
+git push origin $git_branch 2>&1

1-4: This appears to be a standard OpenAPI generator template.

If this file is auto-generated by the OpenAPI generator and not intended to be customized, consider adding it to .openapi-generator-ignore if the issues raised aren't relevant to your workflow, or accept that it follows the upstream template conventions.

Comment on lines +44 to +49
if [ "$GIT_TOKEN" = "" ]; then
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
else
git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git
fi
Copy link
Copy Markdown

@coderabbitai coderabbitai bot Jan 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Security: Token may leak in git config and process listings.

Embedding the token directly in the remote URL stores it in .git/config in plaintext, and it may appear in process listings or debug output. Consider using Git credential helpers or environment-based authentication instead.

🔒 Safer alternative using credential helper
     if [ "$GIT_TOKEN" = "" ]; then
         echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
         git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
     else
-        git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git
+        git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
+        git config credential.helper '!f() { echo "username=${git_user_id}"; echo "password=${GIT_TOKEN}"; }; f'
     fi

Alternatively, if this is a standard OpenAPI generator template that you don't intend to modify, this may be acceptable for CI/CD contexts where the .git directory is ephemeral.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if [ "$GIT_TOKEN" = "" ]; then
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
else
git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git
fi
if [ "$GIT_TOKEN" = "" ]; then
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
else
git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
git config credential.helper '!f() { echo "username=${git_user_id}"; echo "password=${GIT_TOKEN}"; }; f'
fi
🤖 Prompt for AI Agents
In `@openapi/git_push.sh` around lines 44 - 49, The script currently embeds
GIT_TOKEN into the remote URL (the git remote add origin ... branch that uses
${GIT_TOKEN}), which leaks the token into .git/config and process listings;
change the flow to add the remote without the token (use the branch of the
script that uses ${git_host}/${git_user_id}/${git_repo_id}.git) and authenticate
via a credential helper or an ephemeral method instead—for example, set up a
temporary credential using git credential or use git -c
http.extraheader="AUTHORIZATION: Bearer $GIT_TOKEN" for the push, or configure
GIT_ASKPASS to supply the token—so remove any code that constructs the URL with
${GIT_TOKEN} and replace it with a token-passing approach that does not store
the token in .git/config.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is generated

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wolf31o2, understood! Since this is auto-generated by the OpenAPI generator, it's best to leave it as-is. Modifying generated files would cause your changes to be overwritten on the next regeneration. The security concern would need to be addressed upstream in the OpenAPI generator templates if needed, but for your CI/CD use case with ephemeral environments, this should be acceptable.


✏️ Learnings added
Learnt from: wolf31o2
Repo: blinklabs-io/cardano-node-api PR: 525
File: openapi/git_push.sh:44-49
Timestamp: 2026-01-25T22:24:06.100Z
Learning: The file `openapi/git_push.sh` in the cardano-node-api repository is auto-generated by the OpenAPI generator and should not be manually modified, as changes would be overwritten on regeneration.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.


# Pushes (Forces) the changes in the local repository up to the remote repository
echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
git push origin master 2>&1 | grep -v 'To https'
Copy link
Copy Markdown

@coderabbitai coderabbitai bot Jan 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Bug: grep -v inverts the filter, hiding rather than showing the URL.

The comment on line 55 says "Pushes ... the changes" but grep -v 'To https' removes lines containing "To https" from the output rather than showing them. This appears inverted from the intended behavior.

🐛 Proposed fix
-git push origin master 2>&1 | grep -v 'To https'
+git push origin master 2>&1 | grep 'To https'

Or remove the grep entirely if you want to see all output:

-git push origin master 2>&1 | grep -v 'To https'
+git push origin master 2>&1
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
git push origin master 2>&1 | grep -v 'To https'
git push origin master 2>&1 | grep 'To https'
Suggested change
git push origin master 2>&1 | grep -v 'To https'
git push origin master 2>&1
🤖 Prompt for AI Agents
In `@openapi/git_push.sh` at line 57, The push command currently pipes git push
origin master 2>&1 into grep -v 'To https', which removes the "To https" line
(hiding the remote URL) rather than showing it; update the pipeline to either
remove the grep entirely to preserve all output or change to grep 'To https'
(without -v) to explicitly show the URL line (find the git push origin master
command in git_push.sh and adjust the grep usage accordingly).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is generated

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wolf31o2, understood! Since this file is auto-generated by the OpenAPI generator, it shouldn't be manually edited. I'll note this for future reviews and won't flag issues in generated files.


✏️ Learnings added
Learnt from: wolf31o2
Repo: blinklabs-io/cardano-node-api PR: 525
File: openapi/git_push.sh:57-57
Timestamp: 2026-01-25T22:24:16.543Z
Learning: Files in the `openapi/` directory of the cardano-node-api repository are auto-generated by the OpenAPI generator tool and should not be manually edited.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

- API version: 1.0
- Package version: 1.0.0
- Generator version: 7.14.0
- Generator version: 7.18.0-SNAPSHOT
Copy link
Copy Markdown

@coderabbitai coderabbitai bot Jan 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🌐 Web query:

latest stable version openapi-generator 2025

💡 Result:

The latest stable release of OpenAPI Generator in 2025 is v7.18.0, released on December 22, 2025. [1], [2]


🏁 Script executed:

# Check if there's a VERSION file or other configuration in the repo
find . -type f -name "VERSION" -o -name "pom.xml" -o -name "build.gradle" -o -name "package.json" | head -20

Repository: blinklabs-io/cardano-node-api

Length of output: 109


🏁 Script executed:

# Check the context around line 10 in openapi/README.md to understand more
cat openapi/README.md | head -30

Repository: blinklabs-io/cardano-node-api

Length of output: 931


🏁 Script executed:

cat ./openapi/.openapi-generator/VERSION

Repository: blinklabs-io/cardano-node-api

Length of output: 88


Upgrade generator version to stable release.

The openapi-generator version should be updated from 7.18.0-SNAPSHOT to 7.18.0 (stable). The stable release has been available since December 22, 2025, and using the production-ready version is recommended over the pre-release build.

🤖 Prompt for AI Agents
In `@openapi/README.md` at line 10, Update the OpenAPI generator version string in
the README by replacing the pre-release token "Generator version:
7.18.0-SNAPSHOT" with the stable release "Generator version: 7.18.0" so the
documentation references the production-ready generator; locate the exact line
containing the "Generator version: 7.18.0-SNAPSHOT" entry and change it to
"Generator version: 7.18.0".

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wolf31o2, understood. I'll leave the generator version as is.


🧠 Learnings used
Learnt from: wolf31o2
Repo: blinklabs-io/cardano-node-api PR: 525
File: openapi/git_push.sh:44-49
Timestamp: 2026-01-25T22:24:06.100Z
Learning: The file `openapi/git_push.sh` in the cardano-node-api repository is auto-generated by the OpenAPI generator and should not be manually modified, as changes would be overwritten on regeneration.

@wolf31o2 wolf31o2 merged commit a905711 into main Jan 25, 2026
11 checks passed
@wolf31o2 wolf31o2 deleted the fix/openapi-darwin branch January 25, 2026 22:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants